FROM openjdk:8-jre-alpine

LABEL maintainer="CodeBuddy"
LABEL description="下载管理服务"

# 设置时区
RUN apk add --no-cache tzdata && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone

# 创建应用目录和下载目录
WORKDIR /app
RUN mkdir -p /app/downloads

# 复制jar文件
COPY target/download-service-*.jar app.jar

# 暴露端口
EXPOSE 8082

# 启动应用
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=docker", "app.jar"]